<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "carousel".
 *
 * @property integer $id
 * @property string $name
 * @property string $img
 * @property string $link
 * @property string $status
 * @property string $created_at
 * @property string $updated_at
 */
class Carousel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'carousel';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['img', 'created_at', 'updated_at'], 'required'],
            [['created_at', 'updated_at','status'], 'integer'],
            [['name'], 'string', 'max' => 20],
            [[ 'link'], 'string', 'max' => 255],
            //[['name'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'name' => Yii::t('app', 'Name'),
            'img' => Yii::t('app', 'Img'),
            'link' => Yii::t('app', 'Link'),
            'status' => Yii::t('app', 'Status'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }

    /**
     * @inheritdoc
     * @return CarouselQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new CarouselQuery(get_called_class());
    }
}
